<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="applicable-device" content="mobile">
    <link href="/js/channel-4d2699.min.css" rel="stylesheet" type="text/css">
    <title>景点门票</title>
    <meta name="keywords" content="景点门票">
    <meta name="description" content="景点门票">
    <meta name="HandheldFriendly" content="true">
    <meta name="MobileOptimized" content="width">
    <meta name="viewport" id="viewport"
          content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/index.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css" rel="stylesheet" >
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css" rel="stylesheet" >
    <script src="/js/plugins/jquery-form/jquery.form.js"></script>
    <script>

        $(function () {
            var currentPage = 1;
            var totalPage = 1;
            var dataList = [];
            var keyword;
            var id;

            function query() {
                $.get("/scenics",{currentPage:currentPage,keyword:keyword},function (data) {
                    $.merge(dataList,data.list);
                    $('.search-list-box').renderValues({list:dataList},{
                        setVal:function (item, value) {
                            $(item).attr('data-id',value);
                        }
                    });
                    $('.money').click(function () {
                        var id = $(this).data('id');
                        window.location.href="/mine/pay.html?id=" + id;
                    })

                    currentPage += 1;
                    totalPage = data.pages;
                })
            }
            query();

            $(window).scroll(function () {
                //触发翻页的ajax去查询
                //触发翻页的时机.  屏幕高度+滚动高度>=数据的高度的时候
                if ($(window).height()+$(document).scrollTop()>=$(document).height()) {
                    //解决翻页底部问题,一直发送请求,如果当前页小于总页数的时候
                    if (currentPage <= totalPage) {
                        query();
                    } else {
                        //已经到最后一页
                        $(document).dialog({
                            type: "notice",
                            infoText: "到底了........",
                            autoClose: 1000,
                            position: "bottom" //在底部显示
                        })
                    }
                }
            })
            $('.test-box').click(function () {
                currentPage = 1;
                $('#searchForm').ajaxSubmit(function (data) {
                    dataList= data.list;
                    $('.search-list-box').renderValues({list:dataList},{
                        setVal:function (item, value) {
                            $(item).attr('data-id',value);
                        }
                    });
                    keyword = $('#keyword').val();
                    $('.money').click(function () {
                        var id = $(this).data('id');
                        window.location.href="/mine/pay.html?id=" + id;
                    })
                    currentPage += 1;
                    totalPage = data.pages;
                })
            })

            $('.icon-title-back').click(function () {
                window.location.href="index.html";
            })


        })
    </script>

    <style type="text/css">
        .test-box{
            width:50px;
            height:35px;
            margin:14px auto;
            position:relative;
            border:1px solid #333;
        }
    </style>

</head>
<body style="font-size: 12px;">

<div>
    <div>
        <div style="top: 0px; position: sticky; z-index: 100;" >
            <header class="header-box" id="header" ><span class="header-back" >
                <i class="icon-title-back effect-active" ></i></span>
                <h1 ><span >景点门票</span></h1></header>
        </div>
        <div class="">
            <div class="row nav-search">
                <div class="col-10">
                    <div class="input-group-sm search">
                        <form id="searchForm" action="/scenics" method="get">
                            <input class="form-control " id="keyword" name="keyword" placeholder="请输入目的地:北京/上海/广州">
                        </form>
                    </div>
                </div>
                <div class="col-2 ">
                    <button class="test-box" ><span>查询</span></button>
                </div>
            </div>
        </div>
        <div class="channel-container" id="main-container">
            <div class="content-container">

                <div class="activity-new">

                    <ul class="small-banner clearfix">
                        <li><a href="javascript:;">
                            <div>
                                <h2 class="ellips">周末去哪儿</h2>
                                <p class="ellips">正确打开方式</p>
                            </div>
                            <div class="lazy-img-box">
                                <img src="/upload/week.png" lazy="loaded">
                            </div>
                        </a>
                        </li>
                        <li>
                            <a href="javescript:;">
                            <div>
                                <h2 class="ellips">上海迪士尼</h2>
                                <p class="ellips">点亮心中奇梦</p>
                            </div>
                            <div class="lazy-img-box">
                                <img src="/upload/disney.png"  lazy="loaded">
                            </div>
                        </a>
                        </li>
                        <li>
                            <a href="javacript:;">
                            <div><h2 class="ellips">境外精选</h2>
                                <p class="ellips">世界那么大</p>
                            </div>
                            <div class="lazy-img-box"><img src="/upload/egpyt.png"  lazy="loaded">
                            </div>
                            </a>
                        </li>
                    </ul>
                </div>

                    <div class="bar-top clearfix">
                        <div class="title">精选</div>
                    </div>
                <div class="search-list-inner">
                    <section class="search-list-container">
                        <div class="search-list-inner">
                            <ul class="search-list-box">
                                <div id="sceniclist" render-loop="list">
                                <li class="search-block clearfix">
                                    <a class="search-scenic-link"  href="javascript:;">
                                        <div class="img-container lazy-img-box fl" >
                                            <img class="img" render-src="list.coverUrl" lazy="loaded" >
                                        </div>
                                        <div class="search-scenic-content">
                                            <h3 class="search-scenic-title ellips ft-color-deepgrey" render-html="list.name"></h3>
                                            <div class="search-scenic-wrapper">
                                                <div class="search-scenic-detail">
                                                    <ul class="sale-type clearfix">
                                                        <li class="fl"><span class="sale-lable sale-lable-0">优惠</span>
                                                        </li>  <!----></ul>
                                                    <p class="scenic-comment ellips">新品上线 | 100%满意</p>
                                                </div>
                                                <div class="search-scenic-price">
                                                    <i class="rmb-symbol">¥</i>
                                                    <span class="money" render-html="list.price"></span>起&nbsp;&nbsp;&nbsp;
                                                </div>
                                                <div class="search-scenic-price">
                                                    <div class="money" id="money" data-id="" render-fun="setVal" render-key="list.id">购票</div>
                                                </div>
                                            </div>
                                            <div class="search-scenic-footer">
                                                <div class="search-scenic-city ft-color-grey" render-html="list.parent.name"></div>
                                                <div class="search-scenic-distance ft-color-grey"></div>
                                            </div>
                                        </div>
                                    </a>
                                </li>
                                </div>
                            </ul>
                            <p class="page-infinite-loading" style="display: none;"> 正在加载中... </p>
                        </div>
                    </section>

                </div>
            </div>
            </div>
        </div>
        <footer class="inform-box">
            <ul class="inform-list clearfix">
                <li><i class="icon-security2"></i> <span>入园保障</span></li>
                <li><i class="icon-sale"></i> <span>最优折扣</span></li>
                <li><i class="icon-comment4"></i> <span>点评奖金</span></li>
            </ul>
        </footer>
    </div>
</div>

<script src="/js/channel-4d2699.min.js" type="text/javascript">

</script>
</body>
</html>